# BOPTOOLS : BOPMAP script mapping variables - debug mode
# mop files

SOURCES = maptypes.ml parserMop.ml lexerMop.ml bopmapimp.ml
CMX = $(patsubst %.ml, %.cmx, $(SOURCES))
CMO = $(patsubst %.ml, %.cmo, $(SOURCES))

all : $(CMX) $(CMO) bopmap

bopmap : $(CMX) bopmap.ml
	ocamlopt -o $@ unix.cmxa graphics.cmxa -I $(BEBOPDIR)/boplibs bplib.cmxa $^

%.cmo : %.ml 
	ocamlc -c -I $(BEBOPDIR)/boplibs bebop.cma $<

%.cmx : %.ml
	ocamlopt -c -I $(BEBOPDIR)/boplibs bplib.cmxa $<

lexerMop.ml : lexerMop.mll maptypes.ml
	ocamllex lexerMop.mll

parserMop.ml : parserMop.mly maptypes.ml
	ocamlyacc $<
	ocamlopt -c  -I $(BEBOPDIR)/boplibs bebop.cmxa parserMop.mli

clean :
	rm -f lexerMop.ml parserMop.ml parserMop.mli
	rm -f *.cmx *.cmi *.o *.cmo

